package com.zy.config;

import com.zy.util.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandlerController  {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public R handlerException(Exception e){
        return R.error(e.getMessage());
    }
}
